package com.my.chapter7;

public class practice10 {
    public static void main(String[] args) {
        Stem1 s = new Stem1(6);
    }
}

class Component11{
    public Component11(int i){
        System.out.println("Component1 constructor"+i);
    }
}

class Component21{
    public Component21(int i){
        System.out.println("Component2 constructor"+i);
    }
}

class Component31{
    public Component31(int i){
        System.out.println("Component3 constructor"+i);
    }
}

class Root1{
    private Component11 c1 =new Component11(1);
    private Component21 c2 =new Component21(2);
    private Component31 c3 =new Component31(3);
    public Root1(int i){
        System.out.println("Root constructor"+i);
    }
}

class Stem1 extends Root1{
    public Stem1(int i){
        super(i);
        System.out.println("Stem constructor"+i);
    }
}
